<?php

/**
 * Subclass for performing query and update operations on the 'products' table.
 *
 * 
 *
 * @package lib.model
 */ 
class ProductsPeer extends BaseProductsPeer
{
  public static function getImage($id){
    $c = new Criteria();
    $c->add(ProductsPeer::PRODUCTS_ID, $id);
    $product = ProductsPeer::doSelectOne($c);
    $image = (sfConfig::get('sf_upload_dir_name').'/products/cart_thumbnails/'.$product->getProductsImage());
    return $image;
  }
  public static function getName($id){
    $c = new Criteria();
    $c->add(ProductsPeer::PRODUCTS_ID, $id);
    $product = ProductsPeer::doSelectOne($c);
    $name = $product->getProductsName();
    return substr($name, 0, 12)."...";
  }
  public static function getPrice($id){
    $c = new Criteria();
    $c->add(ProductsPeer::PRODUCTS_ID, $id);
    $product = ProductsPeer::doSelectOne($c);
    $price = $product->getProductsPrice();
    return $price;
  }
  public static function getModel($id){
    $c = new Criteria();
    $c->add(ProductsPeer::PRODUCTS_ID, $id);
    $product = ProductsPeer::doSelectOne($c);
    $model = $product->getProductsModel();
    return $model;
  }
}
